{extend name='common/common' /}

{block name="style"}
<link href="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet">
<style>
    .ibox-content{
        padding: 0px;
        border-top: none;
    }
    .layui-elem-field legend {
        margin-left: 0px;
        font-size: 20px;
        font-weight: 300;
        padding: 0px 10px;
        margin-bottom: 0px;
    }
    .form-group{
        line-height: 34px;
    }
    textarea.form-control{
        height: 100px;
    }
    .checkbox label, .radio label{
        line-height: 5px;
    }
    .configure{
        border: 1px solid #e5e6e7;
        min-height: 40px;
    }
    .fa.fa-remove{
        display: none;
    }
    .badge{
        display: none;
    }

    .layui-form-item{
        margin-bottom: 0px;
    }
    .form-Track{
        display: inline-block;
        margin-bottom: 0px;
    }
	#ID_Photo{
		width: 190px;
		height: 271px;
		background: blue;
		color:#FFF;
		line-height: 421px;
		cursor: pointer;
	}
</style>
{/block}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-10">
            <div class="ibox float-e-margins">
                <div class="ibox-content">

                    <div class="layui-tab layui-tab-card" lay-filter="test">
                        <ul class="layui-tab-title">
                            <li class="layui-this" lay-id="33">客户基本信息</li>
                            <li lay-id="44">跟踪信息</li>
                            <li lay-id="55">订单录入</li>
							<li lay-id="66">上传照片</li>
                        </ul>
                        <div class="layui-tab-content" style="height: auto;">
                            <!--  客户基本信息  -->
                            <div class="layui-tab-item layui-show">
                                <form class="form-horizontal m-t" id="commentForm" method="post" action="{:url('member/memberedit')}">
                                    <input type="hidden" name="id" value="{$memberArr['id']}"/>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">姓名：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="name" type="text" class="form-control" name="name" required="" aria-required="true" value="{$memberArr['name']}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">联系电话：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="phone" type="text" class="form-control" name="phone" required="" aria-required="true" value="<?= $memberArr['phone'];?>">
                                        </div>
                                    </div>
									<div class="form-group">
                                        <label class="col-sm-3 control-label">性　　别:</label>
                                        <div class="input-group col-sm-7">
                                            <select name="sex" id="sex" class="form-control" >
                                                <option value="1">男</option>
												<option value="2">女</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">地址：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="adress" class="form-control" name="adress" value="{$memberArr['adress']}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">QQ：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="qq" class="form-control" name="qq" value="{$memberArr['qq']}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">微信：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="weixin" class="form-control" name="weixin" value="{$memberArr['weixin']}">
                                        </div>
                                    </div>

									<!-- 学历  -->
									<div class="form-group">
										<label class="col-sm-3 control-label">学历：</label>
										<div class="input-group col-sm-7">
											<input id="education" class="form-control" name="education">
										</div>
									</div>
									<!-- 意向专业 -->
									<div class="form-group">
										<label class="col-sm-3 control-label">意向专业：</label>
										<div class="input-group col-sm-7">
											<input id="intention" class="form-control" name="intention">
										</div>
									</div>
									<!-- 工作行业 -->
									<div class="form-group">
										<label class="col-sm-3 control-label">工作行业：</label>
										<div class="input-group col-sm-7">
											<input id="industry" class="form-control" name="industry">
										</div>
									</div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">等级：</label>
                                        <div class="input-group col-sm-7">
                                            <select name="grade" id="grade" class="form-control"  >
                                                <option value="{$memberArr.grade}" selected>{$memberArr.gradeN}</option>
                                                <?php foreach($gradeArr as $val):?>
                                                    <option value="<?=$val['id'];?>"><?=$val['name'];?></option>
                                                <?php endforeach;?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">状态：</label>
                                        <div class="input-group col-sm-7">
                                            <select class="form-control" name="status" id="status">
                                                <option value="<?= $memberArr['status'];?>"><?= $memberArr['statusN'];?></option>
                                                <?php foreach($statusArr as $val):?>
                                                    <option value="<?=$val['id'];?>"><?=$val['name'];?></option>
                                                <?php endforeach;?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">所属咨询师：</label>
                                        <div class="input-group col-sm-7">
											<input type="hidden" id="relation_id" class="form-control" name="relation_id" value="{$memberArr['relation_id']}">
                                            <input id="relation" class="form-control" name="relation" value="{$memberArr['relation']}" readonly>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">添加时间：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="time" class="form-control" name="time" value="{$memberArr['time']}" readonly>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">备注：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="remarks" class="form-control" name="remarks" value="{$memberArr['remarks']}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-5 col-sm-offset-7" style="padding-left: 6%">
                                            <button class="btn btn-primary" type="submit" style="margin-right: 25px">确认提交</button>
                                            <a href="javascript:;" onclick="javascript:history.back(-1);">
                                                <button type="button" class="btn btn-primary btn-sm" style="width: 82px;height: 34px;">
                                                    返回
                                                </button>
                                            </a>
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <!--  跟踪信息  -->
                            <div class="layui-tab-item">
                                <form id="formDemo" class="layui-form" action="{:url('member/trackList')}" method="post">
                                    <!-- 新增时间  -->
                                    <div class="content clearfix m-b">
                                        <div class="form-group form-Track">
                                            <label>日期范围：</label>
                                            <div class="layui-form layui-inline">
                                                <div class="layui-form-item" style="margin-bottom: 0px">
                                                    <div class="layui-inline">
                                                        <div class="layui-input-inline">
                                                            <input type="hidden" id="m_id" name="mid" value="<?=$mid;?>">
                                                            <input type="text" class="layui-input" name="KL-time" id="KL-time" placeholder="开始 到 结束">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group form-Track">
                                            <button class="btn btn-primary" type="button" id="search" onclick="trackList()">
                                                <strong>搜 索</strong>
                                            </button>
                                        </div>
                                    </div>
                                </form>
                                <fieldset class="layui-elem-field layui-field-title" style="margin-left: 0px;">
                                    <!--  添加追踪  -->
                                    <legend>
                                        <a href="{:url('member/addTrack',['mid'=>$mid])}">
                                            <button class="btn btn-outline btn-primary" type="button">
                                                添加追踪
                                            </button>
                                        </a>
                                    </legend>
                                </fieldset>
                                <div class="layui-form">
                                    <table class="layui-table">
                                        <colgroup>
                                            <col width="50">
                                            <col width="100">
                                            <col width="100">
                                            <col width="250">
                                            <col width="150">
                                            <col width="130">
                                        </colgroup>
                                        <thead>
                                        <tr>
                                            <th>ID</th>
                                            <th>客户名字</th>
                                            <th>录入人</th>
                                            <th>内容</th>
                                            <th>时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody class="trackList">
                                            <?php if(empty($memberArr['track'])): ?>
                                                <tr>
                                                    <td colspan="6" class="text-center span-strong">暂无数据</td>
                                                </tr>
                                            <?php else: ?>
                                                <?php foreach($memberArr['track'] as $val): ?>
                                                <tr>
                                                    <td><?=$val['id'];?></td>
                                                    <td><?=$memberArr['name'];?></td>
                                                    <td><?=$val['username'];?></td>
                                                    <td><?=$val['content'];?></td>
                                                    <td><?=$val['time'];?></td>
                                                    <td>
                                                        <a href="javascript:void(0);">
                                                            <button onclick="tosee(<?=$val['id']?>);" type="button" class="btn btn-primary btn-sm" style="background-color:#1ab394;border-color:#1ab394;">
                                                                查看
                                                            </button>
                                                        </a>
                                                        <a href="javascript:void(0);">
                                                            <button class="btn btn-danger btn-sm getIDs" onclick="delTrack(<?=$val['id']?>)">
                                                                删除
                                                            </button>
                                                        </a>
                                                    </td>
                                                </tr>
                                                <?php endforeach;?>
                                            <?php endif;?>
                                        </tbody>
                                    </table>
                                </div>

                            </div>
                            <!--  订单录入 -->
                            <div class="layui-tab-item">
                                <form class="form-horizontal m-t" id="orderAdd" method="post" action="{:url('Order/orderAdd')}">
                                    <!--  会员id值  -->
                                    <input type="hidden" name="m_id" value="{$memberArr['id']}"/>
                                    <!--  录入信息  -->
                                    <input type="hidden" name="relation_id" value="{$memberArr['relation_id']}"/>
									<input type="hidden" name="time" value="{$memberArr['time']}"/>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">姓名：</label>
                                        <div class="input-group col-sm-7">
                                            <!-- 报考者名字 -->
                                            <input id="stu_name" type="text" class="form-control" name="stu_name" required="" aria-required="true" value="{$memberArr['name']}" readonly>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">联系电话：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="ord_phone" type="text" class="form-control" name="phone" required="" aria-required="true" value="<?= $memberArr['phone'];?>" readonly>
                                        </div>
                                    </div>

									<div class="form-group">
                                        <label class="col-sm-3 control-label">地		址：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="adress" type="text" class="form-control" name="adress" required="" aria-required="true" value="<?= $memberArr['adress'];?>" readonly>
                                        </div>
                                    </div>

									<div class="form-group">
                                        <label class="col-sm-3 control-label">民　　族：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="nation" type="text" class="form-control" name="nation" required="" aria-required="true" value="<?= $memberArr['nation'];?>">
                                        </div>
                                    </div>
									<div class="form-group">
										<label class="col-sm-3 control-label">身份证号：</label>
										<div class="input-group col-sm-7">
											<input id="id_card" type="text" class="form-control" name="id_card" required="" aria-required="true" value="<?= $memberArr['id_card'];?>">
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-3 control-label">生　　日：</label>
										<div class="input-group col-sm-7">
											<input id="birthday" type="text" class="form-control" name="birthday" required="" aria-required="true" value="<?= $memberArr['birthday'];?>">
										</div>
									</div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">报考院校：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="school_id" type="hidden" class="form-control" name="school_id"
                                                   required="" aria-required="true">
                                            <input id="school" type="text" class="form-control" name="school" required=""
                                                   aria-required="true" readonly placeholder="点击选择学校和专业">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">就读专业：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="major_id" type="hidden" class="form-control" name="major_id"
                                                   required="" aria-required="true">
                                            <input id="major" type="text" class="form-control" name="major"
                                                   required="" aria-required="true" readonly placeholder="点击选择学校和专业">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">产品名称：</label>
                                        <div class="input-group col-sm-7">
                                            <select name="name" id="product_name" class="form-control" >
                                                <option value="">请选择</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">配置:</label>
                                        <div class="input-group col-sm-7 configure">

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">支付方式：</label>
                                        <div class="input-group col-sm-7">
                                            <select name="pay_type" id="pay_type" class="form-control">
                                                <option value="">请选择</option>
                                                <?php foreach($payTypeArr as $val): ?>
                                                    <option value="<?=$val['id'];?>"><?=$val['name'];?></option>
                                                <?php endforeach;?>
                                            </select>
                                        </div>
                                    </div>

                                    <!-- <div class="form-group">
                                        <label class="col-sm-3 control-label">录入方式：</label>
                                        <div class="input-group col-sm-7">
                                            <select name="entry_mode" id="entry_mode" class="form-control">
                                                <option value="">请选择</option>
                                                <option value="1">财务录入</option>
                                                <option value="2">业务录入</option>
                                            </select>
                                        </div>
                                    </div> -->

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">备注：</label>
                                        <div class="input-group col-sm-7">
                                            <input id="ord_remarks" class="form-control" name="remarks">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-5 col-sm-offset-7" style="padding-left: 6%">
                                            <button class="btn btn-primary" type="submit" style="margin-right: 25px">确认提交</button>
                                            <a href="javascript:;" onclick="javascript:history.back(-1);">
                                                <button type="button" class="btn btn-primary btn-sm" style="width: 82px;height: 34px;">
                                                    返回
                                                </button>
                                            </a>
                                        </div>
                                    </div>
                                </form>
                            </div>
							<!-- 上传照片 -->
							<div class="layui-tab-item">
								<!-- 上传1寸照片 -->
								<div class="form-group">
									<label class="col-sm-3 control-label">一寸照片：</label>
									<div class="input-group col-sm-7">
										<div class="layui-input-inline">

											<div id="ID_Photo" data-action="uploadMemberPhoto" data-multiple="false" data-ext="png,jpg,jpeg" data-upload="stidphoto/memIdPhoto_<?=$memberArr['id']?>"></div>
										</div>
									</div>
								</div>
							</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="laycontent" style="display: none;width: 300px;padding: 30px 15px;">
    <ul id="tree"></ul>
</div>
{/block}


{block name="script"}
<script src="__JS__/jquery.min.js?v=2.1.4"></script>
<script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
<script src="__JS__/content.min.js?v=1.0.0"></script>
<script src="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script>
<script src="__JS__/plugins/validate/jquery.validate.min.js"></script>
<script src="__JS__/plugins/validate/messages_zh.min.js"></script>
<script src="__JS__/layui/layui.js"></script>
<script src="__JS__/jquery.form.js"></script>
<script type="text/javascript">

    var index = '';
    function showStart(){
        index = layer.load(0, {shade: false});
        return true;
    }
    function showSuccess(res){

        layer.ready(function(){
            layer.close(index);
            if(1 == res.code){
                layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
                    window.location.href = res.data;
                });
            }else if(111 == res.code){
                window.location.reload();
            }else{
                layer.msg(res.msg, {anim: 6});
            }
        });
    }
    $(document).ready(function(){
        // 添加角色
        var options = {
            beforeSubmit:showStart,
            success:showSuccess
        };
        // 提交订单
        $('#orderAdd').submit(function(){
            config();
            $(this).ajaxSubmit(options);
            return false;
        });
        //提交客户信息
        $('#commentForm').submit(function(){
            $(this).ajaxSubmit(options);
            return false;
        });
        //搜索客户跟踪信息
        $('#formDemo').submit(function(){
            $(this).ajaxSubmit(options);
            return false;
        });
    });
    // 表单验证
    $.validator.setDefaults({
        highlight: function(e) {
            $(e).closest(".form-group").removeClass("has-success").addClass("has-error")
        },
        success: function(e) {
            e.closest(".form-group").removeClass("has-error").addClass("has-success")
        },
        errorElement: "span",
        errorPlacement: function(e, r) {
            e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
        },
        errorClass: "help-block m-b-none",
        validClass: "help-block m-b-none"
    });
</script>

<script>
    layui.use('element', function(){
        var $ = layui.jquery ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

        $('.site-demo-active').on('click', function(){
            var othis = $(this), type = othis.data('type');
            active[type] ? active[type].call(this, othis) : '';
        });

        //Hash地址的定位
        var layid = location.hash.replace(/^#test=/, '');
        element.tabChange('test', layid);

        element.on('tab(test)', function(elem){
            location.hash = 'test='+ $(this).attr('lay-id');
//            window.location.reload();
        });
    });
    function tosee(id){
        var app;
        $.post("{:url('member/trackMember')}",{tid:id},function (data){
            app  =  '<div class="form-group" style="margin-top: 20px">'+
                    '<label class="col-sm-3 control-label">客户ID：</label>'+
                    '<div class="input-group col-sm-7">'+
                    '<input id="id" type="text" class="form-control" name="id" required="" aria-required="true" value="'+data["id"]+'" readonly>'+
                    '</div>'+
                    '</div>'+
                    '<div class="form-group">'+
                    '<label class="col-sm-3 control-label">姓名：</label>'+
                    '<div class="input-group col-sm-7">'+
                    '<input id="id" type="text" class="form-control" name="id" required="" aria-required="true" value="'+data["username"]+'" readonly>'+
                    '</div>'+
                    '</div>'+
                    '<div class="form-group">'+
                    '<label class="col-sm-3 control-label">跟踪方式：</label>'+
                    '<div class="input-group col-sm-7">'+
                    '<input id="id" type="text" class="form-control" name="id" required="" aria-required="true" value="'+data["typeN"]+'" readonly>'+
                    '</div>'+
                    '</div>'+
                    '<div class="form-group">'+
                    '<label class="col-sm-3 control-label">咨询师：</label>'+
                    '<div class="input-group col-sm-7">'+
                    '<input id="id" type="text" class="form-control" name="id" required="" aria-required="true" value="'+data["memberN"]+'" readonly>'+
                    '</div>'+
                    '</div>'+
                    '<div class="form-group">'+
                    '<label class="col-sm-3 control-label">录入时间：</label>'+
                    '<div class="input-group col-sm-7">'+
                    '<input id="id" type="text" class="form-control" name="id" required="" aria-required="true" value="'+data["time"]+'" readonly>'+
                    '</div>'+
                    '</div>'+
                    '<div class="form-group">'+
                    '<label class="col-sm-3 control-label">跟踪备注：</label>'+
                    '<div class="input-group col-sm-7">'+
                    '<textarea name="" id="" class="form-control" cols="100%" rows="100%" readonly>'+data["content"]+'</textarea>'+
                    '</div>'+
                    '</div>'
            layer.open({
                title: '追踪信息',
                type:1,
                area:["50%","50%"],
                content:app
            });
        })
    }
    function delTrack(id) {
        $.post("{:url('member/trackDel')}",{tid:id},function (data) {
            if(data.code == 1){
                layer.msg(data.msg, {time : 1000});
                window.location.reload();
            }else{
                layer.msg(data.msg, {time : 1000});
            }
        })
    }

    $(function(){
        getTree();
        layui.use(['form'], function(){
            var form = layui.form;
        });

        $('#school').on('click',function(){
            selectSchoolBox = layer.open({
                type: 1,
                title: '请选择学校和专业',
                anim: 2,
                skin: 'layui-layer-molv', //加上边框
                area: ['300px', '350px'], //宽高
                content: $(".laycontent")
            });
        });
        $('#major').on('click',function(){
            selectSchoolBox = layer.open({
                type: 1,
                title: '请选择学校和专业',
                anim: 2,
                skin: 'layui-layer-molv', //加上边框
                area: ['300px', '350px'], //宽高
                content: $(".laycontent")
            });
        });
		if("{$memberArr.id_photo_url}" != ""){
			$("#ID_Photo").css({"background":"url({$memberArr.id_photo_url}) no-repeat","background-size":"190px 271px"});
		}
    })
    function getTree(){
            layui.use(['tree', 'layer'], function(){
                var layer = layui.layer;

                $.getJSON("{:url('product/school')}", function(res){
                    if(111 == res.code){
                        window.location.reload();
                    }
                    layui.tree({
                        elem: '#tree'
                        ,nodes: res.data
                        ,click: function(node){
                            if(node.pid != 0){
                                $('#major').val(node.name);
                                $('#major_id').val(node.id);
                                for(var i=0;i<res.data.length;i++){
                                    if(node.pid == res.data[i].id){
                                        $('#school').val(res.data[i].name);
                                        $('#school_id').val(res.data[i].id);
                                    }
                                }
                                layer.closeAll();
                            }
                            var school_id = node.pid;
                            var major_id = node.id;
                            $.post("{:url('order/productList')}",{
                                school_id:school_id,
                                major_id:major_id
                            },function (data) {
                                if (data != null || data != '') {
                                    var app = '<option value="">请选择</option>';
                                    for(var i in data){
                                        app += '<option value="'+data[i]["id"]+'">'+data[i]["name"]+'</option>'
                                    }
                                    $('#product_name').html(app);
                                    $('#product_name').on('change',function(){
                                        var  product_id = $('#product_name').val();
                                        $.post("{:url('Order/configList')}",{
                                            product_id:product_id
                                        },function (res) {
                                            var king = '';
                                            for(var i=0;i<res.data.length;i++){
                                                king += '<p><input type="radio" name="cofigArr" id="cofigArr">' + res.data[i] + '</p>';
                                            }
                                            $('.configure').html(king);

                                            var aBadge = $('.badge');
                                            for(var i=0;i<aBadge.length;i++){
                                                console.log(aBadge[i].getAttribute('data-param'));
                                            }
                                        })
                                    })
                                } else{
                                    layer.msg('没有产品', {time : 1000});
                                }
                            })
                        }
                    });
                });
        });
    }
    //重写配置
    function config() {
        $('input[name="cofigArr"]').each(function(){
            if($(this).is(':checked')){
                var val;
                val = $(this).siblings('.badge').attr('data-param');
                $(this).val(val);
            }
        })
    }
    //时间段选择
    //时间选择
    layui.use('laydate', function() {
        var laydate = layui.laydate;
        //日期范围
        laydate.render({
            elem: '#KL-time'
            ,range: true
        });
		laydate.render({
			elem: '#birthday',
			type: 'date'
		});
    })

    function trackList() {
        var time = $('#KL-time').val();
        var mid = $('#m_id').val();
        if (time == null || time == ''){
            layer.msg('时间不能为空', {time: 1000});
            return false;
        }
        $.post("{:url('member/trackList')}",{
            time:time,
            mid:mid
        },function (res) {
            var app = '';
            if(res.code == -1){
                layer.msg(res.msg, {time: 1000});
            }
            if(res == null || res == ''){
                app += '<tr><td colspan="6" class="text-center span-strong">暂无数据</td></tr>';
            }else{
                for(var i in res){
                    app += '<tr>'+
                            '<td>'+res[i]["id"]+'</td>'+
                            '<td>'+res[i]["name"]+'</td>'+
                            '<td>'+res[i]["username"]+'</td>'+
                            '<td>'+res[i]["content"]+'</td>'+
                            '<td>'+res[i]["time"]+'</td>'+
                            '<td>' +
                            '<a href="javascript:void(0);">'+
                            '<button onclick="tosee('+res[i]['id']+');" type="button" class="btn btn-primary btn-sm" style="background-color:#1ab394;border-color:#1ab394;margin-right: 4px">'+
                            '查看'+
                            '</button>'+
                            '</a>'+
                            '<a href="javascript:void(0);">'+
                            '<button class="btn btn-danger btn-sm getIDs" onclick="delTrack('+res[i]['id']+')">'+
                            '删除'+
                            '</button>'+
                            '</a>'+
                            '</td>'+
                            '</tr>';
                }
            }
            $('.trackList').html(app);
            layer.msg('加载成功', {time: 1000});
        })
    }
</script>
{/block}
